package lc.q151_200;

public class Q171 {

    public int titleToNumber(String columnTitle) {
        // 分割
        char[] charArray = columnTitle.toCharArray();
        int res = 0;
        for (char c : charArray) {
            int i1 = c - 'A' + 1;
            res = res * 26 + i1;
        }
        return res;
    }

    public static void main(String[] args) {
        int i = new Q171().titleToNumber("AB");
        System.out.println(i);
    }
}
